package com.seu.nic.component.coder;

import io.netty.buffer.ByteBuf;
import io.netty.buffer.ByteBufUtil;
import io.netty.channel.ChannelHandlerContext;
import io.netty.handler.codec.LineBasedFrameDecoder;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class DebugDecoder extends LineBasedFrameDecoder {
    public DebugDecoder(int maxLength) {
        super(maxLength);
    }

    @Override
    protected Object decode(ChannelHandlerContext ctx, ByteBuf buffer) throws Exception {
        log.info("原始字节: " + ByteBufUtil.hexDump(buffer));
        return super.decode(ctx, buffer);
    }
}